package com.sjf.common;

/**
 * 封装threadLocal工具类
 * @author <huangtang>
 * @since 2022/4/26 10:09
 **/
public class BaseContext {

    private static final ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void remove() {
        threadLocal.remove();
    }
}

